module.exports = {
  up: function(migration, DataTypes, done) {
    // add altering commands here, calling 'done' when finished

    migration.createTable('notes',
      {
        id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
        user_id:       { type:DataTypes.INTEGER  },
        conversation_id: { type:DataTypes.INTEGER  },
        location_id:     { type:DataTypes.INTEGER  },
        text:            { type:  DataTypes.TEXT   },
        added:           { type:  DataTypes.DATE   },
        createdAt:       { type: DataTypes.DATE    },
        updatedAt:       { type: DataTypes.DATE    },
      },
      {
        engine: 'InnoDB', // default: 'InnoDB'
      }
    )

    done()
  },
  down: function(migration, DataTypes, done) {
    // add reverting commands here, calling 'done' when finished
    migration.dropTable('notes')
    done()
  }
}
